import java.util.ArrayList;

public class StudentTest {
    public static void main(String[] args) {
        int[] array1 = new int[3];
        Student[] array2 = new Student[3];
        // <Student>代表这个集合里面只能放Student
        ArrayList<Student> list = new ArrayList<>();

        Student student1 = new Student();
        student1.setId(1);
        student1.setName("张三1");
        student1.setAge(23);
        student1.setGender("男");
        list.add(student1);

        Student student2 = new Student();
        student2.setId(2);
        student2.setName("张三2");
        student2.setAge(23);
        student2.setGender("女");
        list.add(student2);

        for (Student student : list) {
            System.out.println(student);
        }


    }
}
